﻿using System;
using System.IO;

class PrintOddLinesOfTextFile
{
    static void Main()
    {
        //Exercise 1.
        //Write a program that reads a text file and prints on the console its odd lines.

        string fileName = @"C:\Users\Toni\Desktop\Test File.txt";
        StreamReader reader = new StreamReader(fileName);

        using (reader)
        {
            int lineNumber = 0;
            string line = reader.ReadLine();
            while (line != null)
            {
                lineNumber++;                
                if (lineNumber % 2 != 0)
                {                    
                    Console.WriteLine("Line {0}: {1}", lineNumber, line);                    
                }
                line = reader.ReadLine();
            }
        }

    }
}

